package com.wn.storage.mapper;

import com.wn.storage.entity.Storage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

public interface StorageMapper extends BaseMapper<Storage> {

    //减库存    通过商品的编号减少库存
    @Update("update t_storage set `count` = `count` - #{count} where goods_no = #{goodsNo}")
    int deduct(@Param("goodsNo") String goodsNo, @Param("count") int count);
}
